<div ms-controller="user_add">
	<div class="location_box">
		<div class="return_title">
			<a class="return_button" ms-on-click="history"><img src="../img/icon_return.png"/></a>
            <a ms-on-click="load('home_cloud.html')">首页</a>
			<span>&gt;</span>
			<span>人资管理</span>
            <span>&gt;</span>
            <a class="" ms-on-click="load('user_list.html',8)">用户列表</a>
			<span>&gt;</span>
            <span ms-if="operate==0">添加用户</span>
            <span ms-if="operate==1">修改用户</span>
		</div>
		<div class="button_box">
            <a ms-if="operate==0" class="button_save" ms-on-click="save">保存</a>
            <a ms-if="operate==1" class="button_save" ms-on-click="update">确认修改</a>
		</div>
	</div>
	<div class="add_item_box">
		<div class="add_item" ms-if="operate==0">
			<label>用户名</label>
			<input type="text" ms-duplex="userName" placeholder="4-18个字母数字字符，首位必须为字母">
		</div>
        <div class="add_item" ms-if="operate==1">
            <label>用户名</label>
            <input type="text" ms-duplex="userName" disabled>
        </div>
		<div class="add_item">
			<label>真实姓名</label>
			<input type="text" ms-duplex="trueName" placeholder="2-6个任意字符，请如实填写">
		</div>
	</div>
    <div class="add_item_box">
        <div class="add_item">
            <label>所属公司</label>
            <select ms-on-change="changeCompany" ms-duplex="companyId">
                <option></option>
                <option ms-repeat="companyList" ms-attr-value="el.id">{{el.name}}</option>
            </select>
        </div>
        <div class="add_item">
            <label>所属公司站点</label>
            <select ms-duplex="companyPointId">
                <option></option>
                <option ms-repeat="companyPointList" ms-attr-value="el.id">{{el.name}}</option>
            </select>
        </div>
    </div>
    <div class="add_item_box">
        <div class="add_item">
            <label>手机号码</label>
            <input type="text" ms-duplex="phone" placeholder="请输入手机号码">
        </div>

    </div>
    <div class="add_item_box">
        <div class="userRole">用户角色</div>
        <div class="userRoleListBox" >
            <div class="userRoleList" ms-repeat="addUserRoleList" >
                <input  type="checkbox" name="addUserRoleList" ms-attr-value="el.roleId" ms-attr-id="{{el.roleId}}" ms-duplex-checked="el.pass"><label ms-attr-for="{{el.roleId}}">{{el.roleName}}</label>
            </div>
        </div>
      <!--  <div ms-repeat="roleList" >
          <input  type="checkbox" name="addUserRoleList" ms-attr-value="el.roleId" ms-attr-id="{{el.roleId}}" ms-duplex-checked="el.pass"/><label  ms-attr-for="{{el.roleId}}">{{el.roleName}}</label>
        </div>-->

    </div>
    <div class="tips_add">
        <div ms-if="saveStatus==1">
            <span class="success_tip">保存成功！</span>用户编号为 {{code}}，请到 <a href="http://www.qinms.com/webapp/barcode/index.aspx">http://www.qinms.com/webapp/barcode/index.aspx</a> 网站生成用户条码。默认登录密码为 123456，请用户登录后及时修改密码
        </div>
        <div ms-if="saveStatus==2">
            <span class="fail_tip">保存失败</span>，{{errorMessage}}
        </div>
    </div>
</div>